package com.mly.service.imp;

import com.alibaba.fastjson.JSONObject;
import com.mly.dao.TypeDao;
import com.mly.entity.Type;
import com.mly.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import orm.base.Ex.BaseServiceEx;

import java.util.List;
import java.util.Map;

/**
 * Created by ashin on 2018/3/27.
 */
@Service
public class TypeServiceImp extends BaseServiceEx implements TypeService{

    @Autowired
    TypeDao typeDao;

    @Override
    public void init() {
        super.init(typeDao);
    }

    @Override
    public JSONObject queryTypes(Map map) throws Exception{
        List<Type> typeMap = typeDao.query(map);
        return this.codeData(typeMap);
    }

    @Override
    public JSONObject selectType(Map map) throws Exception {
        Map typeMap = typeDao.selectp(map);
        return this.codeData(typeMap);
    }

    @Override
    public JSONObject queryType(Map map) throws Exception {
        List<Map> typeMap = typeDao.queryType(map);
        return this.codeData(typeMap);
    }
}
